package com.wd.live.base

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import androidx.lifecycle.ViewModel
import com.wd.live.R


abstract class BaseFragment <V:ViewModel,D:ViewDataBinding>(private val layout:Int): Fragment() {
    lateinit var viewModel:V
    lateinit var dataBinding:D
    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        // Inflate the layout for this fragment
         dataBinding=DataBindingUtil.inflate(inflater,layout, container, false)
        dataBinding.lifecycleOwner=this
        return dataBinding.root
    }


}